﻿using System.Windows;
namespace CustomControls
{
    public partial class TextBlockPanelHeader 
    {
        public TextBlockPanelHeader()
        {
            InitializeComponent();
        }
        #region Text (DependencyProperty)
        public string Text
        {
            get { return (string)GetValue(TextProperty); }
            set { SetValue(TextProperty, value); }
        }
        public static readonly DependencyProperty TextProperty =
            DependencyProperty.Register("Text", typeof(string), typeof(TextBlockPanelHeader),
              new PropertyMetadata{PropertyChangedCallback = TextPropertyChanged});
        private static void TextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TextBlockPanelHeader tbph = d as TextBlockPanelHeader;
            if (tbph != null)
            {
                tbph.Tb1.Text = e.NewValue.ToString();
            }
        }
        #endregion
    }
}
